home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
UTIL
/
KEYBOARD
/
FASTTASK
/
!FastTask
/
Docs
/
TaskEnsure
< prev
next >
Wrap
Text File
|
1994-03-31
|
3KB
|
116 lines
TaskEnsure v0.00
© Ben Summers 1993
TaskEnsure will only work properly under RISC OS 3.
What?
~~~~~
I'm sure you will all realise how useful the RMensure command is when you
want to load a module, but only if it's not already loaded. The TaskEnsure
utility allows you to do the same with a WIMP task.
I've set up my computer using various desktop boot files to set up an
environment for various tasks, for example loading printer drivers,
Impression and Draw and opening a few directories for document processing.
Now, using this utility, I can check to see if an application is already
present before loading it so I don't get multiple copies of applications if
I run the desktop boot file again, or want to run another one for doing two
or more things at once.
This utility will only work under RISC OS 3. Under OS2, it'll assume that
the task is not present. This is because it uses calls new to OS3.
How?
~~~~
You have a choice on how to use TaskEnsure. Firstly, you could copy the
TaskEnsure file into your Library directory, or you could load the
TaskEnsurM module. The first option is probably best for hard disc users.
I've provided it as a module and an executable file so that you can make the
choice.
Either way, the effect will be to add another *command to the vast
repertoire your computer already has. The syntax is
TaskEnsure [-p] <task name> <*command>
The task name is the name of the task to check for. Matching is case
sensitive. If the task name includes spaces, enclose the task name in "s.
If the task is not present, the *command is executed. This may include
spaces without quotes... simply, the rest of the line is sent to the CLI.
If the -p options is included (it's position is important), the sense of the
command is reversed, and the command is executed if the task IS present. I
wish RMensure had this facility!
Examples
~~~~~~~~
To load Draw it it's not already present.
TaskEnsure Draw Filer_Run resources:$.Apps.!Draw
To load a printer driver if draw is present.
TaskEnsure -p Draw TaskEnsure "Printer Manager" Filer_Run ADFS::Ben.$
.Document.Printers.!Printers
note: this command should be all on one line.
This last example illustrates three points. Firstly that the -p option is
actually useful, and secondly the 'double' TaskEnsure command. The first
TaskEnsure sees if Draw is present, the second only loads Printers is it is
not already loaded. Thirdly, the task name of Printers has a space in it and
so is enclosed in quotes.
Source code
~~~~~~~~~~~
The source code of TaskEnsure is included in this distribution. TaskEnsure
is written in ARM code, and is assembled by the Acorn Assembler (not the
BASIC one).
Please do not distribute modified versions of this source code.
Distribution
~~~~~~~~~~~~
I retain copyright on all executable code, source code and documentation.
However, you may distribute it free of charge as long as it is UNMODIFIED.
Reasonable charges for media and distribution are acceptable.
The author
~~~~~~~~~~
TaskEnsure was written by Ben Summers. You can contact me at the address
below. Enclose an SAE if you want a reply.
If you send a disc, I'll copy the latest versions of all my PD programs onto
it before sending it back.
Ben Summers
1 St Clements Hill
Norwich
NR3 4DE
email: bsummers@cix.compulink.co.uk
Use and enjoy!